<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center huishoujil_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub huishoujil_fd0_0'>
          <view class='flex flex-wrap align-center huishoujil_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  huishoujil_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='huishoujil_fd0_0_c1_c0'>{{tabs==1 ? '库存记录' : '出库记录'}}</text>
          </view>
          <view class='flex flex-wrap align-center justify-end huishoujil_fd0_0_c0' @click="isShow=true">
            <text class='fu-iconfont2'>&#xe756;</text>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <view v-if="tabs==1">
        <benben-flex-tabs class-name='huishoushuju_benbenTabsfd2_0' v-model="tabsTypefd2_0" ref="benben_tabsfd2_0"
          select-mark="benben_tabsfd2_0" key="benben_tabsfd2_0" :open-title-type='false' :open-sticky='true' :top='0'
          :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd2_0">

          <scroll-view @scroll="tabsInfofd2_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd2_0"
            class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd2_0.moveX"
            scroll-with-animation="all .3s ease">
            <view class="benben-tabs-content" id="benben_tabsfd2_0-content">
              <view id="benben_tabsfd2_0-title" class="benben-tabs-title flex flex align-center justify-around">
                <view :class="{ 'checkTitlefd2_0': tabsTypefd2_0 == '0', 'flex flex-wrap align-center': true }"
                  @tap="tabsTypefd2_0 = '0'" :id="`benben_tabsfd2_0-title-item-${'0'}`">

                  <text>全部</text>

                </view>
                <view :class="{ 'checkTitlefd2_0': tabsTypefd2_0 == '2', 'flex flex-wrap align-center': true }"
                  @tap="tabsTypefd2_0 = '2'" :id="`benben_tabsfd2_0-title-item-${'2'}`">

                  <text>收入</text>

                </view>
                <view :class="{ 'checkTitlefd2_0': tabsTypefd2_0 == '3', 'flex flex-wrap align-center': true }"
                  @tap="tabsTypefd2_0 = '3'" :id="`benben_tabsfd2_0-title-item-${'3'}`">

                  <text>支出</text>

                </view>
              </view>
              <view :style="{ left: tabsInfofd2_0.lineleft, maxWidth: tabsInfofd2_0.lineWidth ,}"
                id="benben_tabsfd2_0-line" class="benben-tabs-line flex benben-flex-tabs-line huishoushuju_linefd2_0">
              </view>
            </view>
          </scroll-view>

        </benben-flex-tabs>

      </view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout huishoujil_flex_1">
        <template v-for='(item,key0) in dataList'>
          <view class='flex flex-direction align-stretch huishoujil_fd1_0' :key='key0'>
            <view class='flex flex-wrap align-center justify-between flex-sub huishoujil_fd1_0_c0'>
              <view class='flex flex-wrap align-center'>
                <text>更新时间：</text>
                <text>{{item.create_time}}</text>
              </view>

            </view>
            <view class='flex flex-wrap align-center'>
              <text class='huishoujil_fd1_0_c1_c0'>型号</text>
              <text class='huishoujil_fd1_0_c1_c1'>{{item.cate}}</text>
            </view>
            <view class='flex flex-wrap align-center'>
              <text class='huishoujil_fd1_0_c1_c0'>进出量</text>
              <text class='huishoujil_fd1_0_c1_c1'>{{tabs==2 ? item.weghit :item.quantity}}</text>
            </view>
            <view v-if="tabs==2">
              <view class='flex flex-wrap align-center'>
                <text class='huishoujil_fd1_0_c1_c0'>地址</text>
                <text class='huishoujil_fd1_0_c1_c1'>{{item.address}}</text>
              </view>
              <view class='flex flex-wrap align-center'>
                <text class='huishoujil_fd1_0_c1_c0'>完成时间</text>
                <text class='huishoujil_fd1_0_c1_c1'>{{item.time}}</text>
              </view>
              <view class='flex flex-wrap align-center orderList_fd3_1_c4_c0'>
                <text class="huishoujil_fd1_0_c1_c0">回收师傅</text>
                <view class='text-cut flex align-center '>
                  <image class='orderList_fd3_1_c4_c1_c2' mode="aspectFit" :src='item.head_img'></image>
                  <view class="text-cut huishoujil_fd1_0_c1_c1">{{item.user_nickname}}</view>
                </view>
                <!-- <image class='orderList_fd3_1_c4_c1_c2' mode="aspectFit" :src='STATIC_URL+"6.png"'></image> -->
              </view>
            </view>

            <view class='flex flex-wrap align-center' v-if="tabs==1">
              <text class='huishoujil_fd1_0_c1_c0'>备注</text>
              <text class='huishoujil_fd1_0_c1_c1'>{{item.remarks}}</text>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->


    </view>
    <!-- 日历弹框 start -->
    <fu-popup v-model="isShow" mode="center" :mask-close-able="true" @close="closePopup">
      <view class="calendar-box">
        <fu-calendar @change="change" active-bg-color="#10337e" range-bg-color="#16583d1a" :future="true" start-text=""
          end-text="" mode="range" :isDefaultDay="false" :start-time="start_data" :end-time="end_data"></fu-calendar>
      </view>
    </fu-popup>
    <!-- 日历弹框 end -->
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd2_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        tabsTypefd2_0: '0',
        isShow: false,
        "start_data": "",
        "end_data": "",
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "dataList": [],
        tabs: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      userInfo: {
        get() {
          return this.$store.state.userInfo
        },
        set() {
          this.$store.commit('updateUserInfo', value)
        },
      },
    },
    watch: {},
    onLoad(options) {
      this.tabs = options.type
      this.getii65d1779f0b5b5Func()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      change(value) {
        if (value.isInit) return;
        this.end_data = value.end
        this.start_data = value.start
        this.isShow = false;
        console.log(value)
      },
      closePopup() {
        this.isShow = false;
        this.getii65d1779f0b5b5Func()
      },
      //师傅端订单列表
      getii65d1779f0b5b5Func() {
        let create_time = ''
        if (this.end_data) {
          create_time = this.start_data + ',' + this.end_data
        }
        let urldata = ""
        if (this.tabs == 1) {
          urldata = global.apiUrls.post66b96fddac8de
        } else {
          urldata = global.apiUrls.post66b9fb15aa346
        }
        this.minixPagingListsApi = urldata;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          create_time: create_time,
          type: 0,
          user_id: this.userInfo.id
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  ::v-deep .huishoushuju_benbenTabsfd2_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
  }

  .huishoushuju_linefd2_0 {
    background: rgba(238, 190, 25, 1);
    width: 100rpx;
    height: 8rpx;
    top: 80rpx;
    background-size: 100% auto !important;
  }

  .checkTitlefd2_0 {
    font-weight: 700 !important;
    font-size: 32rpx !important;
    color: #10337E !important;
    background-color: rgba(255, 255, 255, 1) !important;
  }

  .orderList_fd3_1_c4_c0_c1 {
    width: 380rpx;
    color: rgba(16, 51, 126, 1);
    margin: 0rpx 0rpx 0rpx 24rpx;
  }

  .orderList_fd3_1_c4_c0 {
    line-height: 28rpx;
  }

  .orderList_fd3_1_c4_c1_c2 {
    width: 36rpx;
    height: 36rpx;
    margin: 0rpx 24rpx 0rpx 0;
  }

  // 日历弹框 start
  .calendar-box {
    background: #FFF;
    border-radius: 16rpx;
    width: 640rpx;
    padding: 0 24rpx;
    border: 1px solid transparent;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .huishoujil_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .huishoujil_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .huishoujil_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .huishoujil_fd0_0_c0 {
    width: 120rpx;
  }

  .huishoujil_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .huishoujil_flex_1 {
    background: #F8F8F8;
    background-size: 100% auto;
    height: 100vh;
  }

  .huishoujil_fd1_0_c1_c1 {
    color: #333;
    font-size: 26rpx;
  }

  .huishoujil_fd1_0_c1_c0 {
    color: var(--benbenFontColor2);
    font-size: 26rpx;
    padding: 24rpx;
  }

  .huishoujil_fd1_0_c0_c1_c0 {
    font-size: 28rpx;
    color: rgba(16, 51, 126, 1);
  }

  .huishoujil_fd1_0_c0 {
    background: linear-gradient(90deg, #D9E4FF 0%, rgba(217, 228, 255, 0) 100%);
    border-radius: 16rpx 16rpx 0rpx 0rpx;
    width: 686rpx;
    font-size: 28rpx;
    padding: 16rpx 24rpx 16rpx 24rpx;
  }

  .huishoujil_fd1_0 {
    background: #FFF;
    width: 686rpx;
    margin: 24rpx auto 0rpx auto;
    background-size: 100% auto;
  }
</style>
